package com.nbjtjc.safe.api.safe;

import com.nbjtjc.common.validator.ValidatorUtils;
import com.nbjtjc.safe.bean.Result;
import com.nbjtjc.safe.model.safe.SafeDangerInspectPlan;
import com.nbjtjc.safe.model.safe.SafeInspectTable;
import com.nbjtjc.safe.service.safe.SafeInspectTableServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/safe/table")
@CrossOrigin("*")
public class SafeInspectTableController {

    @Autowired
    private SafeInspectTableServiceImpl tableService;
    @PostMapping(value = "/add")
    public Result add(SafeInspectTable safeInspectTable){
//        ValidatorUtils.validateEntity(safeInspectTable);
        return tableService.add(safeInspectTable);
    }

    @PostMapping(value = "/delete")
    public Result delete(SafeInspectTable table){
//        ValidatorUtils.validateEntity(table);
        return tableService.delete(table);
    }
    @PostMapping(value = "/update")
    public Result update(SafeInspectTable table){
//        ValidatorUtils.validateEntity(safeDangerInspectPlan);
        return tableService.update(table);
    }

    @PostMapping(value = "/search")
    public Result search(SafeInspectTable table){
//        ValidatorUtils.validateEntity(safeDangerInspectPlan);
        return tableService.search(table);
    }
}
